import request from '@/utils/request'

//左侧抓拍列表
export function getSnapList(query) {
    return request({
        url: 'gui/home/snapList',
        method: 'get',
        params: query
    })
}

//底部预警列表
export function getwarningList(query) {
    return request({
        url: 'user/home/warningList',
        method: 'get',
        params: query
    })
}

//最多跑一次统计列表接口
export function getOnceCountList(query) {
    return request({
        url: 'user/count/list',
        method: 'get',
        params: query
    })
}
//办理时限统计
export function getDurationCountList(query) {
    return request({
        url: 'user/duration/list',
        method: 'get',
        params: query
    })
}

//人员识别初始化列表 用户识别
export function getUserList(data) {
    console.log(data)
    return request({
        url: 'user/user/searchUser',
        method: 'post',
        data
    })
}

//人员识别初始化列表 用户画像
export function getUserListImage(data) {
    return request({
        url: 'user/userList/searchUserList',
        method: 'post',
        data
    })
}


//考勤列表
export function getWorkList(query) {
    return request({
        url: 'gui/work/list',
        method: 'get',
        params: query
    })
}

//人员检索api/gui/user/search
export function searchUser(data) {
    return request({
        url: 'user/user/searchUser',
        method: 'post',
        data
    })
}

//上传图片/api/upload/image
export function uploadImg(data) {
    return request({
        url: 'upload/image',
        method: 'post',
        data
    })
}


//摄像头列表
export function getCameraList(query) {
    return request({
        url: 'gui/home/cameraList',
        method: 'get',
        params: query
    })
}

//excel导出
export function exportSnapExcel(query) {
    return request({
        url: 'gui/work/snapExcel',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}

//服务类型列表
export function getServiceList(query) {
    return request({
        url: 'user/zone/selectList',
        method: 'get',
        params: query
    })
}

//最多统计一次 柱状图
export function getCountBar(query) {
    return request({
        url: 'user/count/bar',
        method: 'get',
        params: query
    })
}



//最多统计一次 饼状图
export function getCountPie(query) {
    return request({
        url: 'user/count/pie',
        method: 'get',
        params: query
    })
}


/**
 * 最多统计一次 饼状图点击跳转
 * @param 三个可选参数 1.startTime 开始时间 2.endTime 结束时间 3.str 频率次数字符串
 * @returns 返回对象 data属性是该频率段数据
 */
export function countPieJump(query) {
    return request({
        url: 'user/count/pieParticulars',
        method: 'get',
        params: query
    })
}

export function countDataExport(query) {
    return request({
        url: 'user/count/excel',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}


//时长统计图柱状图
export function getDurationBar(query) {
    return request({
        url: 'user/duration/bar',
        method: 'get',
        params: query
    })
}


//时长 饼状图
export function getDurationPie(query) {
    return request({
        url: 'user/duration/pie',
        method: 'get',
        params: query
    })
}

// 时长 数据导出
export function timeDataExport(query) {
    return request({
        url: 'user/duration/excel',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}


//轨迹列表
export function getUsertraceList(query) {
    return request({
        url: 'user/userList/traceList',
        method: 'get',
        params: query
    })
}

//轨迹时间轴
export function getUserTimeline(query) {
    return request({
        url: 'user/userList/userTimeline',
        method: 'get',
        params: query
    })
}


//业务设置
export function warningSetting(data) {
    return request({
        url: 'gui/warning/setting',
        method: 'post',
        data
    })
}

//业务列表渲染
export function getWarningTypeList(query) {
    return request({
        url: 'gui/warning/warning_type_list',
        method: 'get',
        params: query
    })
}

//区域流量实时图
export function getFlowList(query) {
    return request({
        url: 'gui/flow/flow_list',
        method: 'get',
        params: query
    })
}

//区域流量导出
export function areaFlowDerivation(query) {
    return request({
        url: 'user/flow/excel',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}

//当天流量趋势图
export function getCurrentDayFlowList(query) {
    return request({
        url: 'user/flow/current_day',
        method: 'get',
        params: query
    })
}



//最近一周区域流量实时图
export function getLatestWeekFlow(query) {
    return request({
        url: 'user/flow/latest_week',
        method: 'get',
        params: query
    })
}

//最近一个月
export function getLatestMonthFlow(query) {
    return request({
        url: 'user/flow/latest_month',
        method: 'get',
        params: query
    })
}

//最近三个月
export function getLatestThreeMonthFlow(query) {
    return request({
        url: 'user/flow/latest_tree_month',
        method: 'get',
        params: query
    })
}

// 首页统计
export function getHomepageStatistics(query) {
    return request({
        url: 'user/home/selectCount',
        method: 'get',
        params: query
    })
}

// 人员信息
export function getPersonnelInformation(query) {
    return request({
        url: 'user/userList/selectUserList',
        method: 'get',
        params: query
    })
}

// 人员库
export function getStorehouse(query) {
    return request({
        url: 'user/userType/selectUserType',
        method: 'get',
        params: query
    })
}

//人员列表添加
export function listOfPeopleIsAdded(data) {
    return request({
        url: 'user/userList/addUserList',
        method: 'post',
        data
    })
}

//抓拍情况详情
export function getParticulars(query) {
    return request({
        url: 'user/count/particulars',
        method: 'get',
        params: query
    })
}

//首页统计已处理预警
export function homeStatisticsProcessedAlerts(query) {
    return request({
        url: 'user/home/HomeIsWarning',
        method: 'get',
        params: query
    })
}

//首页统计平均
export function homeStatisticalAverage(query) {
    return request({
        url: 'user/home/HomeSelectDuration',
        method: 'get',
        params: query
    })
}

//首页统计预警
export function homeStatisticsAlert(query) {
    return request({
        url: 'user/home/HomeWarning',
        method: 'get',
        params: query
    })
}



// 人员信息2
export function getPersonnelInformation2(query) {
    return request({
        url: 'user/user/selectUserByUserId',
        method: 'get',
        params: query
    })
}

// 人员识别详情
export function personIdentificationDetails(data) {
    return request({
        url: '/user/user/searchUserParticulars',
        method: 'post',
        data
    })
}

//首页区域平均时间 折线图
export function getDurationAvg(query) {
    return request({
        url: 'user/home/selectDuration',
        method: 'get',
        params: query
    })
}

//首页预警次数 折线图
export function getWarningSum(query) {
    return request({
        url: 'user/home/warning',
        method: 'get',
        params: query
    })
}

//首页已处理次数 折线图
export function getDisposeWarning(query) {
    return request({
        url: 'user/home/isWarning',
        method: 'get',
        params: query
    })
}

//首页人数分布
export function getUserSum(query) {
    return request({
        url: 'user/home/selectUser',
        method: 'get',
        params: query
    })
}


//首页区域平均人数 折线图
export function getAveragePerson(query) {
    return request({
        url: 'user/home/selectDurationNumber',
        method: 'get',
        params: query
    })
}

